using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using AutoGear.BLL;

public partial class contactus : SitePublicBasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        uccResponseMessage.Visible = false;
        if (!IsPostBack) 
        {
            GenerateSEOData();
        }
    }
    private void GenerateSEOData()
    {
        //SEOHelper.RenderTitle(this.Page, "Contact Polana :: Traditional Polish foods, steaks, Polish sausages, Polish dumplings, Polish pastries, Polish soups, Polish stews by Polana ", true);
        //SEOHelper.RenderMetaTag(this.Page, "description", "Polana Contact Us. Authentic, traditional Polish sausages, kielbasa, smoked sausages, bacon, blood sausage, steaks, premade dishes, parties, torts, breads, coffees, teas, canned goods, dry goods, recipes and more from Polana.", true);
        //SEOHelper.RenderMetaTag(this.Page, "keywords", "authentic, traditional, kielbasa, buy polish food, order polish food, dumplings, coffee, tea, cookies, chocolates, pastries, torts, soups, stews, European sausage, fresh polish sausage, smoked sausage, polish food, polish recipes, polish hams, polish bacons, fresh sausage, sausages, deli sausage, smoked sausages, blood sausages, headcheese, polish cheese, polish hams, polish blood sausage, polish bacon, wienners", true);
        SEOHelper.RenderMetaTag(this.Page, "robots", "ALL", true);
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        try
        {
            Page.Validate();
            if (Page.IsValid)
            {
                Inquires inquery = new Inquires();
                inquery.Name = tbxName.Text;
                inquery.Organization = tbxOrganization.Text;
                inquery.EmailAddress = tbxEmail.Text;
                inquery.Telephone = tbxTelephone.Text;
                inquery.Website = tbxWebsiteAddress.Text;
                inquery.Subject = tbxSubjectOfInquiry.Text;
                inquery.Inquiry = tbxInquiry.Text;
                inquery.CreateDate = DateTime.Now;
                inquery.IsContacted = false;
                inquery.Create();
                Email.SendInqueryEmailToAdmin(inquery);
                uccResponseMessage.SetSuccessMessage(AutoGearCommonMessage.InquirySentMessage);
                uccResponseMessage.Visible = true;
            }
        }
        catch (Exception ex) {
            uccResponseMessage.SetFailMessage(AutoGearCommonMessage.CommonFailure);
            uccResponseMessage.Visible = true;
        }
    }
}
